#pragma once
#include "Definitions.hpp"

namespace Button
{
    enum class Action
    {
        Press,
        Release,
        Repeat
    };

    struct Modifiers
    {
        bool Shift;
        bool Control;
        bool Alt;
        bool Super;
    };

    enum class Type
    {
        MouseLeft,
        MouseRight,
        MouseMiddle,
        KeySpace,
        KeyApostrophe,
        KeyComma,
        KeyMinus,
        KeyPeriod,
        KeySlash,
        Key0,
        Key1,
        Key2,
        Key3,
        Key4,
        Key5,
        Key6,
        Key7,
        Key8,
        Key9,
        KeySemicolon,
        KeyEqual,
        KeyA,
        KeyB,
        KeyC,
        KeyD,
        KeyE,
        KeyF,
        KeyG,
        KeyH,
        KeyI,
        KeyJ,
        KeyK,
        KeyL,
        KeyM,
        KeyN,
        KeyO,
        KeyP,
        KeyQ,
        KeyR,
        KeyS,
        KeyT,
        KeyU,
        KeyV,
        KeyW,
        KeyX,
        KeyY,
        KeyZ,
        KeyLeftBracket,
        KeyBackslash,
        KeyRightBracket,
        KeyGraveAccent,
        KeyWord1,
        KeyWord2,
        KeyEscape,
        KeyEnter,
        KeyTab,
        KeyBackspace,
        KeyInsert,
        KeyDelete,
        KeyRight,
        KeyLeft,
        KeyDown,
        KeyUp,
        KeyPageUp,
        KeyPageDown,
        KeyHome,
        KeyEnd,
        KeyCapsLock,
        KeyScrollLock,
        KeyNumLock,
        KeyPrintScreen,
        KeyPause,
        KeyF1,
        KeyF2,
        KeyF3,
        KeyF4,
        KeyF5,
        KeyF6,
        KeyF7,
        KeyF8,
        KeyF9,
        KeyF10,
        KeyF11,
        KeyF12,
        KeyLeftShift,
        KeyLeftControl,
        KeyLeftAlt,
        KeyLeftSuper,
        KeyRightShift,
        KeyRightControl,
        KeyRightAlt,
        KeyRightSuper,
        KeyMenu
    };
}

class WindowEventHandler
{
public:
    WindowEventHandler();
    void setViewPort(const u32 width, const u32 height);
    void setMousePosition(const u32 x, const u32 y);
    void handleButtonEvent(Button::Type const& type, Button::Action const& action, Button::Modifiers const& modifiers);
private:
    u32 m_viewPortWidth;
    u32 m_viewPortHeight;
    u32 m_mousePositionX;
    u32 m_mousePositionY;
};
